#include <stdio.h>
#include <unistd.h>
#include <pthread.h>   

void* count1(void* c)
{
    if(c == NULL)
    {
        for(int j=0; j<20; j++)
        {
            printf("arg is NULL\n");
            sleep(1);
        }
        
    }else{
        
        for(int i=0; i<10; i++)
        {
            *(int*)c += 1;
            printf("count1 result: %d\n", *(int*)c);
            sleep(1);
        }
        // printf("count1 result: %d\n", *(int*)c);
    }
    
    return NULL;
}

int main() 
{
    int a = 10;
    int* pa = &a;

	pthread_t t3;
    pthread_t t4;

	pthread_create(&t3, NULL, count1, NULL);
	pthread_create(&t4, NULL, count1, (void*)pa);

    sleep(5);
    printf("hello wolrd from c language\n");
	return 0;
}